/*Do file for main analysis reported in "Information Valence and Evaluations of 
Congress and Individual Legislators: Experimental Evidence Regarding Negativity 
Bias in Politics" */
*Legislative Studies Quarterly
*Kal Munis (University of Virginia) & Henry Ashton (University of Oklahoma)

/*Note: This .do file corresponds to the analyses reported in our article. 
Likely bots have been removed from the data (see article for more information). */

clear all
set scheme s1mono

cd "path to directory that the data is located in here"

use data_bots_clean.dta
**************************************************************
* ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS *
**************************************************************


************
* Study 1
************
reg study1a i.valence##i.partymatch

reg study1b i.valence##i.partymatch

 *Interaction models
 reg study1a i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle(Marginal Effects of Negative Valence on Time Until Change) ///
 xtitle("Partisanship of Candidate vis a vis Respondent") title("")

 reg study1b i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle(Marginal Effects of Negative Valence on Time Until Change) ///
 xtitle("Partisanship of Congress vis a vis Respondent") title("")
*********
* Study 2
*********

reg study2a i.valence##i.partymatch 

reg study2b i.valence##i.partymatch
 
 *Interaction models
 reg study2a i.valence##ib1.partymatch
 margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle("Marginal Effects of Neg. Valence on # of Behaviors") ///
 xtitle("Partisanship of Legislator vis a vis Respondent") title("")
 
 reg study2b i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle("Marginal Effects of Neg. Valence on # of Behaviors") ///
 xtitle("Partisanship of Congress vis a vis Respondent") title("")

******
* Study 3
*******

anova study3a trivalence if partisanship==0
pwcompare i.trivalence, mcompare(tukey) effects
meansdplot study3a trivalence if partisanship==0, yline(50) outer(2) xlabel(1 "Positive" 2 "Neutral" ///
3 "Negative") ytitle(Congressman Effectiveness) ///
xtitle(Information Valence) title("Figure X. Mean Representative Effectiveness Ratings by Valence")

sum study3a if trivalence==1 & partisanship==0
sum study3a if trivalence==2 & partisanship==0
sum study3a if trivalence==3 & partisanship==0

anova study3b trivalence if partisanship==0
pwcompare i.trivalence, mcompare(tukey) effects
meansdplot study3b trivalence if partisanship==0, yline(50) outer(2) xlabel(1 "Positive" 2 "Neutral" ///
3 "Negative") ytitle(Congressional Effectiveness) ///
xtitle(Information Valence) title("Figure X. Mean Congress Effectiveness Ratings by Valence")

sum study3b if trivalence==1 & partisanship==0
sum study3b if trivalence==2 & partisanship==0
sum study3b if trivalence==3 & partisanship==0


